﻿using System;
using CtCommon.Utility;
using CtCommon.Utility.Result;
using Ct.StudentProject.DTO;
using Ct.StudentProject.Service;

namespace Ct.StudentProject.ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            //IRegService 的实现是  RegService
            //IRegService regService;
            Console.WriteLine("请输入Json语句");
            string JsonText = Console.ReadLine();

            RequestStudent user = JsonText.JSONDeserialize<RequestStudent>();
            RegResultDto RegResult = StudentService.RegStudent(user);
            if (RegResult.ID == 0)
            {
                Console.WriteLine("注册失败:" + RegResult.errMsg);
            }
            else
            {
                Console.WriteLine("注册成功,ID为" + RegResult.ID);
            }
            Console.Read();

        }
    }
}